#include "BasePCH.h"
#include "Core2_Config.h"
#include "Enums.h"
#include "../BaseLib/BaseLib.h"

#ifdef CORE_API_DX11

DXGI_FORMAT DX11Formats[] =
{
	DXGI_FORMAT_UNKNOWN,
	DXGI_FORMAT_B8G8R8A8_UNORM,
	DXGI_FORMAT_R32G32B32A32_FLOAT,
	DXGI_FORMAT_R32_FLOAT,
	DXGI_FORMAT_R16G16_FLOAT,
	DXGI_FORMAT_R16G16B16A16_FLOAT,
};

D3D11_CULL_MODE DX11CullModes[] =
{
	D3D11_CULL_NONE,
	D3D11_CULL_FRONT,
	D3D11_CULL_BACK,
};

D3D11_FILL_MODE DX11FillModes[] =
{
	D3D11_FILL_SOLID,
	D3D11_FILL_WIREFRAME,
	D3D11_FILL_WIREFRAME,
};

D3D11_COMPARISON_FUNC DX11ComparisonFunctions[] =
{
	D3D11_COMPARISON_NEVER,
	D3D11_COMPARISON_LESS,
	D3D11_COMPARISON_EQUAL,
	D3D11_COMPARISON_LESS_EQUAL,
	D3D11_COMPARISON_GREATER,
	D3D11_COMPARISON_NOT_EQUAL,
	D3D11_COMPARISON_GREATER_EQUAL,
	D3D11_COMPARISON_ALWAYS,
};

D3D11_BLEND DX11BlendFactors[] =
{
	D3D11_BLEND_ZERO,
	D3D11_BLEND_ONE,
	D3D11_BLEND_SRC_COLOR,
	D3D11_BLEND_INV_SRC_COLOR,
	D3D11_BLEND_SRC_ALPHA,
	D3D11_BLEND_INV_SRC_ALPHA,
	D3D11_BLEND_DEST_ALPHA,
	D3D11_BLEND_INV_DEST_ALPHA,
	D3D11_BLEND_DEST_COLOR,
	D3D11_BLEND_INV_DEST_COLOR,
	D3D11_BLEND_SRC_ALPHA_SAT,
	D3D11_BLEND_BLEND_FACTOR,
	D3D11_BLEND_INV_BLEND_FACTOR,
};

D3D11_BLEND_OP DX11BlendOps[] =
{
	D3D11_BLEND_OP_ADD,
	D3D11_BLEND_OP_SUBTRACT,
	D3D11_BLEND_OP_REV_SUBTRACT,
	D3D11_BLEND_OP_MIN,
	D3D11_BLEND_OP_MAX,
};

D3D11_FILTER DX11Filters[] =
{
	D3D11_FILTER_MIN_MAG_MIP_POINT,
	D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR,
	D3D11_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT,
	D3D11_FILTER_MIN_POINT_MAG_MIP_LINEAR,
	D3D11_FILTER_MIN_LINEAR_MAG_MIP_POINT,
	D3D11_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR,
	D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT,
	D3D11_FILTER_MIN_MAG_MIP_LINEAR,
	D3D11_FILTER_ANISOTROPIC,
	D3D11_FILTER_COMPARISON_MIN_MAG_MIP_POINT,
	D3D11_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR,
	D3D11_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT,
	D3D11_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR,
	D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT,
	D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR,
	D3D11_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT,
	D3D11_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR,
	D3D11_FILTER_COMPARISON_ANISOTROPIC,
};

D3D11_TEXTURE_ADDRESS_MODE DX11TextureAddressModes[] =
{
	D3D11_TEXTURE_ADDRESS_WRAP,
	D3D11_TEXTURE_ADDRESS_MIRROR,
	D3D11_TEXTURE_ADDRESS_CLAMP,
	D3D11_TEXTURE_ADDRESS_BORDER,
	D3D11_TEXTURE_ADDRESS_MIRROR_ONCE,
};

DWORD DX11TextureWrapModes[] =
{
	//0,
	//D3DWRAP_U,
	//D3DWRAP_V,
	//D3DWRAP_V | D3DWRAP_U,
	//D3DWRAP_W,
	//D3DWRAP_W | D3DWRAP_U,
	//D3DWRAP_W | D3DWRAP_V,
	//D3DWRAP_W | D3DWRAP_V | D3DWRAP_U,
	0
};

DWORD DX11Samplers[] =
{
	//0,
	//1,
	//2,
	//3,
	//4,
	//5,
	//6,
	//7,
	//8,
	//9,
	//10,
	//11,
	//12,
	//13,
	//14,
	//15,
	//D3DVERTEXTEXTURESAMPLER0,
	//D3DVERTEXTEXTURESAMPLER1,
	//D3DVERTEXTEXTURESAMPLER2,
	//D3DVERTEXTEXTURESAMPLER3,
	0
};

/*D3DRENDERSTATETYPE*/ DWORD DX11WrapModes[] =
{
	//D3DRS_WRAP0,
	//D3DRS_WRAP1,
	//D3DRS_WRAP2,
	//D3DRS_WRAP3,
	//D3DRS_WRAP4,
	//D3DRS_WRAP5,
	//D3DRS_WRAP6,
	//D3DRS_WRAP7,
	//D3DRS_WRAP8,
	//D3DRS_WRAP9,
	//D3DRS_WRAP10,
	//D3DRS_WRAP11,
	//D3DRS_WRAP12,
	//D3DRS_WRAP13,
	//D3DRS_WRAP14,
	//D3DRS_WRAP15,
	//(D3DRENDERSTATETYPE)0,
	//(D3DRENDERSTATETYPE)0,
	//(D3DRENDERSTATETYPE)0,
	//(D3DRENDERSTATETYPE)0,
	0
};

COREFORMAT GetFormat(DXGI_FORMAT Format)
{
	switch (Format)
	{
		case DXGI_FORMAT_B8G8R8A8_UNORM: return COREFMT_A8R8G8B8;
		case DXGI_FORMAT_R32G32B32A32_FLOAT: return COREFMT_A32B32G32R32F;
		case DXGI_FORMAT_R32_FLOAT: return COREFMT_R32F;
		case DXGI_FORMAT_R16G16_FLOAT: return COREFMT_G16R16F;
		default: return COREFMT_UNKNOWN;
	}
}

#else
NoEmptyFile();
#endif